programming4us
           
 
 
Sharepoint

Working with Search Page Layouts : Adding Navigation to the Search Center (part 2)

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
7/20/2011 11:15:16 AM

2. Adding Navigation to Search Center Master Page

Although the master page minimal.master has no navigation, it is possible to add it. This is recommended for most corporations. Assume a user executes a search, gets some search results, and then wants to jump back to the root site. The only way is for the user to modify the URL manually, which is not really a feasible option.

To add navigation to the minimal.master, first locate this section in the master page.

<div>
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server" />
</div>

Add the following markup from Listing 2 just before the foregoing markup. This places the navigation in the correct location for it to show properly.

Example 2. Navigation in minimal.master Master Page Markup
<div id="s4-topheader2" class="s4-pr s4-notdlg">
<div class="s4-lp s4-toplinks">
<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
<asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
<SharePoint:AspMenu
ID="TopNavigationMenuV4"
Runat="server"
EnableViewState="false"
DataSourceID="topSiteMap"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
UseSimpleRendering="true"
UseSeparateCss="false"
Orientation="Horizontal"
StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="1"
SkipLinkText=""
CssClass="s4-tn"/>
<SharePoint:DelegateControl runat="server"
ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
<Template_Controls>
<asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="SPNavigationProvider"
id="topSiteMap"
runat="server"
StartingNodeUrl="sid:1002"/>
</Template_Controls>
</SharePoint:DelegateControl>
</asp:ContentPlaceHolder>
</asp:ContentPlaceHolder>
</div>
</div>


Then locate this section in the minimal.master.

<SharePoint:CssRegistration Name="layouts.css" runat="server"/>

Add this just before the foregoing.

<SharePoint:CssRegistration Name="corev4.css" runat="server"/>

After these changes, the minimal.master now includes navigation as seen in Figure 5. As it is only the search center that uses the minimal.master, it is suggested that this master page is deployed throughout the farm to solve the missing navigation issue for all search centers, both current and the ones created later.

Figure 5. Navigation added to minimal.master screen dump

3. Adding Navigation to the SearchMain.aspx Page

Instead of changing the master page named minimal.master, it is also possible to add the top navigation bar directly to the layout of the page. This can be done by adding the following code to the SearchMain.aspx page layout.

Begin to edit the page by selecting Edit in Advanced Mode (using SPD 2010). Then locate this section in the SearchMain.aspx page. Also do the same for SearchResults.aspx.

</ContentTemplate>
</SharePoint:UIVersionedContent>
<SharePoint:UIVersionedContent UIVersion="4" runat="server">
<ContentTemplate>

Add the markup shown in Listing 3 just after the markup shown previously. This way the navigation is added in the right place to make it show exactly as if it were added to the master page using the previously described method.

Example 3. Navigation Markup Added to SearchMain.aspx Page
<div class="s4-lp s4-toplinks" style="background-image:url(/_layouts/images/selbg.png);

background-repeat:no-repeat;
repeat-x:left top; background-color:#f6f6f6; vertical-align:middle; min-height:25px;

border-top:1px solid #e0e0e0;
border-bottom:1px solid #b8babd">
<SharePoint:AspMenu
ID="TopNavigationMenuV4"
Runat="server"
EnableViewState="false"
DataSourceID="topSiteMap"


AccessKey="<%$Resources:wss,navigation_accesskey%>"
UseSimpleRendering="true"
UseSeparateCss="false"
Orientation="Horizontal"
StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="1"
SkipLinkText=""
CssClass="s4-tn"/>
<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource"

Id="topNavigationDelegate">
<Template_Controls>
<asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="SPNavigationProvider"
id="topSiteMap"
runat="server"
StartingNodeUrl="sid:1002"/>
</Template_Controls>
</SharePoint:DelegateControl>
</div>


In the foregoing sample, all the CSS styles come from the SharePoint CSS file named corev4.css. These can be changed to fit other requirements for the look of the page. After these changes, the SearchMain.aspx and SearchResults.aspx pages now include navigation as seen in Figure 6. As it is only the search center that uses SearchMain.aspx and SearchResults.aspx, it is suggested that this page is deployed throughout the farm to solve the missing navigation issue once and for all.

Also notice that the end result from a user's perspective is exactly the same as when adding navigation directly to the master page.

Figure 6. Navigation added to SearchMain.aspx screen dump
Other -----------------
- Working with Search Page Layouts : Understanding Master Pages in SharePoint 2010
- Sharepoint 2010 : Social Networking - Engaging People
- Sharepoint 2010 : Developing a Strategy for SharePoint Community Features
- SharePoint 2010 : SQL Server Reporting Services 2008 (part 3) - Installing and Configuring SQL Server Reporting Services 2008
- SharePoint 2010 : SQL Server Reporting Services 2008 (part 2) - Understanding the Architecture of SQL Server Reporting Services 2008
- SharePoint 2010 : SQL Server Reporting Services 2008 (part 1)
- SharePoint 2010 : Configuring Excel Services
- Excel Capabilities on SharePoint 2010
- Setting Up UAG for SharePoint (part 2) - Publishing SharePoint Through a Portal Trunk in UAG
- Setting Up UAG for SharePoint (part 1) - Setting Up SharePoint for Cross-Firewall Access & Creating Application Portal Trunk in UAG
- Publishing SharePoint 2010 to Mobile Devices : Examining Common Firewall Configurations
- Publishing SharePoint 2010 to Mobile Devices : Setting Up SMS Alerts
- SharePoint 2010 : Deploying and Managing FAST Search with Windows PowerShell (part 2) - Adding FAST Search Server 2010 for SharePoint to a SharePoint 2010 Installation
- SharePoint 2010 : Deploying and Managing FAST Search with Windows PowerShell (part 1) - Using the FAST Search Server 2010 for SharePoint Shell
- SharePoint 2010 : Using Enterprise Search (part 3) - Modifying Authoritative Pages and Search Metadata
- SharePoint 2010 : Using Enterprise Search (part 2) - Administering Content Sources
- SharePoint 2010 : Using Enterprise Search (part 1) - Creating and Managing Search Application Topology
- SharePoint 2010 : Using Windows PowerShell to Manage Search Services and FAST Search - Working with Basic Search
- SharePoint 2010 : Creating an Information Repository with the User Profile Service (part 3) - Profile Synchronization & Setting Up My Sites
- SharePoint 2010 : Creating an Information Repository with the User Profile Service (part 2) - Setting Up and Configuring the User Profile Service
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us